import { Radio } from 'antd';
type IFormDataType = {
    [key: string]: Array<ICheckItem>;
};
type ICheckItem = {
    name: string;
    value: string;
    checked: boolean;
};
const FormRadio: React.FC<IBuildForm.Params> = (props) => {
    const { item } = props;
    const type = item.details?.type || 'default';
    const radioList: IFormDataType = {
        default: [
            // 默认 是否单选
            {
                name: '否',
                value: '1',
                checked: false,
            },
            {
                name: '是',
                value: '2',
                checked: false,
            },
        ],
        marginType: [
            // 金额单位
            {
                name: '元',
                value: '1',
                checked: true,
            },
            {
                name: '卢布',
                value: '2',
                checked: false,
            },
        ],
        priceUnit: [
            // 价格单位
            {
                name: '元',
                value: '元',
                checked: true,
            },
            {
                name: '卢布',
                value: '卢布',
                checked: false,
            },
        ],
        speedUnit: [
            // 速度单位
            {
                name: '天',
                value: '天',
                checked: true,
            },
        ],






        numberUnit: [
            {
                name: '个',
                value: '个',
                checked: true,
            },
            {
                name: '箱',
                value: '箱',
                checked: false,
            },
            {
                name: '套',
                value: '套',
                checked: false,
            },
            {
                name: '千克',
                value: '千克',
                checked: false,
            },
            {
                name: '瓶',
                value: '瓶',
                checked: false,
            },
            {
                name: '包',
                value: '包',
                checked: false,
            },
            {
                name: '米',
                value: '米',
                checked: false,
            },
            {
                name: '平方米',
                value: '平方米',
                checked: false,
            },
            {
                name: '双',
                value: '双',
                checked: false,
            },
            {
                name: '辆',
                value: '辆',
                checked: false,
            },
            {
                name: '盒',
                value: '盒',
                checked: false,
            },
            {
                name: '卷',
                value: '卷',
                checked: false,
            },
            {
                name: '袋',
                value: '袋',
                checked: false,
            },
            {
                name: '升',
                value: '升',
                checked: false,
            },
            {
                name: '立方米',
                value: '立方米',
                checked: false,
            },
            {
                name: '片',
                value: '片',
                checked: false,
            },
            {
                name: '桶',
                value: '桶',
                checked: false,
            },
            {
                name: '厘米',
                value: '厘米',
                checked: false,
            },
            {
                name: '吨',
                value: '吨',
                checked: false,
            },
            {
                name: '台',
                value: '台',
                checked: false,
            },

        ],
    };
    return (
        <Radio.Group {...props}>
            {radioList[type].map((item: ICheckItem) => (
                <Radio value={item.value} key={item.value}>
                    {item.name}
                </Radio>
            ))}
        </Radio.Group>
    );
};
export default FormRadio;
